<%@page import="model.DBAdapter" %>
<%@page import="java.sql.*" %>
<%
	DBAdapter adapter = DBAdapter.getInstance();
	adapter.open();
	ResultSet rs = null;
	String query = "";

	int count = 0;
	query = "SELECT count(*) FROM level_type WHERE level_id > 0";
	rs = adapter.select(query);
	while(rs.next()) {
		count = rs.getInt("count(*)");
	}
	query = "SELECT level_id, level_name, level_abbr_size FROM level_type WHERE level_id > 0 ORDER BY level_id";
	rs = adapter.select(query);
	
	String contentHTML = "";
	contentHTML =  contentHTML
			  	+ "<table cellspacing='0' cellpadding='0' width='100%'>"
			   	+ "<tr height = '22px'>"
			   	+ "<th>"
			   	+ "&nbsp;"
			   	+ "Level Number"
			   	+ "</th>"
			    + "<th>"
			    + "Level Name"
			    + "</th>"
			    + "<th nowrap width= '120px' style='text-align: left !important;'>"
			    + "Abbreviation Size"
			    + "</th>"    
			    + "</tr>";
	
	while(rs.next()) {
		contentHTML = contentHTML
					+ "<tr height = '22px' class='listFour' onmouseover=\"this.oldClassName=this.className;this.className='iehover';\" onmouseout=\"this.className=this.oldClassName;\">"
					+ "<td >"
					+ "&nbsp;"
					+ rs.getString("level_id")
					+ "</td>"
					+ "<td>"
					+ rs.getString("level_name")
					+ "</td>"
					+ "<td>"
					+ rs.getString("level_abbr_size")
					+ "</td>"
					+ "</tr>";
					
	}
	contentHTML = contentHTML
				+ "</table>" ;
%>

<table id="content" cellpadding="0">
<tr>
<td>
	<h2>System Settings > Levels</h2>
	<form method="post" action="">
	<br/>
	    <fieldset>
		    <legend>Levels</legend>
			<%=contentHTML%>
	  	</fieldset>
	</form>	
</td>
</tr>
</table>